package com.killer.controller;

import com.killer.pojo.Student;
import com.killer.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping("/list")
    public List<Student> list() {
        return studentService.list();
    }

    @RequestMapping("/add")
    public Object add(Student student){
        studentService.add(student);
        return "success";
    }
}
